using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WorkFlowCore.BusinessDemo.Web.Entities
{
    public class User
    {
        [Key]
        public int Id { get; set; }

        [Required]
        [MaxLength(50)]
        public string Name { get; set; }

        [Required]
        [MaxLength(20)]
        public string EmployeeNumber { get; set; }

        [Required]

        [MaxLength(20)]
        public string Phone { get; set; }

        [MaxLength(100)]
        public string Email { get; set; }

        public int Gender { get; set; } // 0:未知 1:男 2:女

        public DateTime? BirthDate { get; set; }

        [MaxLength(200)]
        public string Hometown { get; set; }

        public DateTime CreateTime { get; set; }

        [MaxLength(20)]
        public string Creator { get; set; }

        public DateTime UpdateTime { get; set; }

        [MaxLength(20)]
        public string Updater { get; set; }

        public virtual ICollection<UserRole> UserRoles { get; set; }

        public int? OrganizationId { get; set; }

        [ForeignKey("OrganizationId")]
        public virtual Organization Organization { get; set; }
    }
}
